<template>
  <el-table :data="props.data" border>
    <slot name="start" />
    <el-table-column align="center" label="AuditLogId">
      <template #default="scope">
        {{ scope.row.auditLogId }}
      </template>
    </el-table-column>
    <el-table-column align="center" label="EntityTypeFullName">
      <template #default="scope">
        {{ scope.row.entityTypeFullName }}
      </template>
    </el-table-column>
    <el-table-column align="center" label="EntityId">
      <template #default="scope">
        {{ scope.row.entityId }}
      </template>
    </el-table-column>
    <el-table-column align="center" label="ChangeType" width="120">
      <template #default="scope">
        {{ EntityLogEnum[scope.row.changeType] }}
      </template>
    </el-table-column>
    <el-table-column align="center" label="ChangeTime">
      <template #default="scope">
        {{ parseDate2Str(scope.row.changeTime, 'YYYY-MM-DD HH:mm:ss') }}
      </template>
    </el-table-column>
    <slot name="end" />
  </el-table>
</template>

<script setup lang="ts">
import { PropType } from 'vue'

import { EntityLogEnum, IEntityChangeLog } from '@/http/types/entityChangeLog'
import { parseDate2Str } from '@/utils/timeUtils'

const props = defineProps({
  data: {
    type: Array as PropType<IEntityChangeLog[]>,
    default: () => [],
  },
})
</script>

<style scoped lang="scss"></style>
